package home.my.recordmanage.model;

import home.my.base.model.BaseObj;

import java.util.Collection;
import java.util.TreeSet;

/******************************
 * @author ning.ma
 * 创建日期: 2012-6-14 上午11:08:46<br/>
 * 功能：工单实体<br/>
*****************************************/
public class Record extends BaseObj {
	private static final long serialVersionUID = 2812329996742753695L;
	private java.lang.Long receieveDate;
	private java.lang.Long finishDate;
	private java.lang.String company;
	private java.lang.String contact;
	private java.lang.String phone;
	private java.lang.String problemDesc;
	private java.lang.String linkUrl;
	private java.lang.String partner;
	private java.lang.Long partnerDate;
	private java.lang.Integer status;
	private java.lang.String receieveDateStr;
	private java.lang.String finishDateStr;
	private java.lang.String partnerDateStr;
	private ErrorType errorType;
	private RecordSource source;
	private String submitPerson;
	private Integer isBad;
	private Collection<DealIdea> dealIdeas = new TreeSet<DealIdea>();

	public String getTableName(){
		return "RECORD";
	}
	
	public String getFmtStatus(){
		return STATUS.valueMap().get(status);
	}
	
	public String getFmtIsBad(){
		if(isBad==null){
			return "未定义";
		}
		switch(isBad){
		case 0: return "合理";
		case 1: return "不合理";
		default:return "未定义";
		}
	}
	
	public String getShortDesc(){
		return problemDesc!=null && problemDesc.length()>35 ? (problemDesc.substring(0,31)+".....") : problemDesc;
	}
	
	public boolean equals(Object object) {
		if (this == object) {
			return true;
		}
		if (!(object instanceof Record)) {
			return false;
		}
		final Record that = (Record) object;
		if (this.id == null || that.getId() == null
				|| !this.id.equals(that.getId())) {
			return false;
		}
		return true;
	}

	public java.lang.Long getReceieveDate() {
		return receieveDate;
	}

	public void setReceieveDate(java.lang.Long receieveDate) {
		this.receieveDate = receieveDate;
	}

	public java.lang.Long getFinishDate() {
		return finishDate;
	}

	public void setFinishDate(java.lang.Long finishDate) {
		this.finishDate = finishDate;
	}

	public java.lang.String getCompany() {
		return company;
	}

	public void setCompany(java.lang.String company) {
		this.company = company;
	}

	public java.lang.String getContact() {
		return contact;
	}

	public void setContact(java.lang.String contact) {
		this.contact = contact;
	}

	public java.lang.String getPhone() {
		return phone;
	}

	public void setPhone(java.lang.String phone) {
		this.phone = phone;
	}

	public java.lang.String getProblemDesc() {
		return problemDesc;
	}

	public void setProblemDesc(java.lang.String problemDesc) {
		this.problemDesc = problemDesc;
	}

	public java.lang.String getLinkUrl() {
		return linkUrl;
	}

	public void setLinkUrl(java.lang.String linkUrl) {
		this.linkUrl = linkUrl;
	}

	public java.lang.String getPartner() {
		return partner;
	}

	public void setPartner(java.lang.String partner) {
		this.partner = partner;
	}

	public java.lang.Long getPartnerDate() {
		return partnerDate;
	}

	public void setPartnerDate(java.lang.Long partnerDate) {
		this.partnerDate = partnerDate;
	}

	public java.lang.Integer getStatus() {
		return status;
	}

	public void setStatus(java.lang.Integer status) {
		this.status = status;
	}

	public java.lang.String getReceieveDateStr() {
		return receieveDateStr;
	}

	public void setReceieveDateStr(java.lang.String receieveDateStr) {
		this.receieveDateStr = receieveDateStr;
	}

	public java.lang.String getFinishDateStr() {
		return finishDateStr;
	}

	public void setFinishDateStr(java.lang.String finishDateStr) {
		this.finishDateStr = finishDateStr;
	}

	public java.lang.String getPartnerDateStr() {
		return partnerDateStr;
	}

	public void setPartnerDateStr(java.lang.String partnerDateStr) {
		this.partnerDateStr = partnerDateStr;
	}

	public ErrorType getErrorType() {
		return errorType;
	}

	public void setErrorType(ErrorType errorType) {
		this.errorType = errorType;
	}

	public RecordSource getSource() {
		return source;
	}

	public void setSource(RecordSource source) {
		this.source = source;
	}
	public Collection<DealIdea> getDealIdeas() {
		return dealIdeas;
	}

	public void setDealIdeas(Collection<DealIdea> dealIdeas) {
		this.dealIdeas = dealIdeas;
	}

	public String getSubmitPerson() {
		return submitPerson;
	}

	public void setSubmitPerson(String submitPerson) {
		this.submitPerson = submitPerson;
	}

	public Integer getIsBad() {
		return isBad;
	}

	public void setIsBad(Integer isBad) {
		this.isBad = isBad;
	}
}